<?php


namespace App\Response;


class ResponseFormat
{
    public function success($data,$msg='操作成功',$code=200)
    {
        return response()->json(
            [
                'data'=>$data,
                'msg'=> $msg,
                'code'=>$code,
            ],
            200
        );
    }
    public function fail($msg='操作失败',$code=500)
    {
        return response()->json(
            [
                'data'=>"",
                'msg'=> $msg,
                'code'=>$code,
            ],
            200
        );
    }
}
